﻿<%@ Page Title="" Language="C#" MasterPageFile="~/AdminCP/MasterPage/Site1.Master" AutoEventWireup="true" CodeBehind="EmployeeManager.aspx.cs" Inherits="TARS.AdminCP.EmployeeManager" %>
<%@ Register Assembly="Telerik.Web.UI" Namespace="Telerik.Web.UI" TagPrefix="telerik" %>
<asp:Content ID="Content1" ContentPlaceHolderID="head" runat="server">
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="ContentPlaceHolder1" runat="server">
    <telerik:RadSkinManager ID="Metro" runat="server" Skin="Hay" />
        <telerik:RadFormDecorator ID="QsfFromDecorator" runat="server" DecoratedControls="All" EnableRoundedCorners="true" />
        <telerik:RadAjaxPanel ID="RadAjaxPanel1" runat="server" LoadingPanelID="RadAjaxLoadingPanel1">
            <telerik:RadAjaxManager ID="RadAjaxManager1" runat="server">
                <AjaxSettings>
                    <telerik:AjaxSetting AjaxControlID="btnUpdateInfo">
                        <UpdatedControls>
                            <telerik:AjaxUpdatedControl ControlID="RadAjaxPanel1" UpdatePanelCssClass="" />
                        </UpdatedControls>
                    </telerik:AjaxSetting>
                </AjaxSettings>
            </telerik:RadAjaxManager>
            <div>

                <telerik:RadGrid ID="RadGrid1" runat="server" AllowFilteringByColumn="True" AllowPaging="True" AllowSorting="True" AutoGenerateColumns="False" CellSpacing="0" GridLines="None" Skin="Hay" DataSourceID="SqlDataSource1">
                    <ClientSettings>
                        <Selecting AllowRowSelect="True" />
                        <Scrolling AllowScroll="True" UseStaticHeaders="True" />
                    </ClientSettings>
                    <MasterTableView TableLayout="Fixed" DataKeyNames="NewID" DataSourceID="SqlDataSource1" CommandItemDisplay="TopAndBottom">

                        <CommandItemSettings ExportToPdfText="Export to PDF" ShowAddNewRecordButton="False"></CommandItemSettings>

                        <RowIndicatorColumn Visible="True" FilterControlAltText="Filter RowIndicator column">
                            <HeaderStyle Width="20px"></HeaderStyle>
                        </RowIndicatorColumn>

                        <ExpandCollapseColumn Visible="True" FilterControlAltText="Filter ExpandColumn column">
                            <HeaderStyle Width="20px"></HeaderStyle>
                        </ExpandCollapseColumn>

                        <Columns>
                            <telerik:GridBoundColumn DataField="NewID" DataType="System.Guid" Visible="false" FilterControlAltText="Filter NewID column" HeaderText="NewID" ReadOnly="True" SortExpression="NewID" UniqueName="NewID">
                                <ColumnValidationSettings>
                                    <ModelErrorMessage Text="" />
                                </ColumnValidationSettings>
                            </telerik:GridBoundColumn>
                            <telerik:GridBoundColumn DataField="Branches_Name" FilterControlAltText="Filter Branches_Name column" HeaderText="Branches Name" SortExpression="Branches_Name" UniqueName="Branches_Name">
                                <ColumnValidationSettings>
                                    <ModelErrorMessage Text="" />
                                </ColumnValidationSettings>
                            </telerik:GridBoundColumn>
                            <telerik:GridBoundColumn DataField="Username" FilterControlAltText="Filter Username column" HeaderText="Username" SortExpression="Username" UniqueName="Username">
                                <ColumnValidationSettings>
                                    <ModelErrorMessage Text="" />
                                </ColumnValidationSettings>
                            </telerik:GridBoundColumn>
                            <telerik:GridBoundColumn DataField="FullName" FilterControlAltText="Filter FullName column" HeaderText="Full Name" ReadOnly="True" SortExpression="FullName" UniqueName="FullName">
                                <ColumnValidationSettings>
                                    <ModelErrorMessage Text="" />
                                </ColumnValidationSettings>
                            </telerik:GridBoundColumn>
                            <telerik:GridBoundColumn DataField="Emp_Email" FilterControlAltText="Filter Emp_Email column" HeaderText="Email" SortExpression="Emp_Email" UniqueName="Emp_Email">
                                <ColumnValidationSettings>
                                    <ModelErrorMessage Text="" />
                                </ColumnValidationSettings>
                            </telerik:GridBoundColumn>
                            <telerik:GridBoundColumn DataField="Emp_CreatedTime" DataType="System.DateTime" FilterControlAltText="Filter Emp_CreatedTime column" HeaderText="Created Time" SortExpression="Emp_CreatedTime" UniqueName="Emp_CreatedTime">
                                <ColumnValidationSettings>
                                    <ModelErrorMessage Text="" />
                                </ColumnValidationSettings>
                            </telerik:GridBoundColumn>
                        </Columns>

                        <EditFormSettings>
                            <EditColumn FilterControlAltText="Filter EditCommandColumn column"></EditColumn>
                        </EditFormSettings>

                        <PagerStyle PageSizeControlType="RadComboBox"></PagerStyle>
                    </MasterTableView>

                    <PagerStyle PageSizeControlType="RadComboBox"></PagerStyle>

                    <FilterMenu EnableImageSprites="False"></FilterMenu>
                </telerik:RadGrid>

                <asp:SqlDataSource ID="SqlDataSource1" runat="server" ConnectionString="<%$ ConnectionStrings:TARS_DeliveryConnectionString %>" SelectCommand="SELECT * FROM [v_EmployeeManager] ORDER BY [Emp_CreatedTime] DESC"></asp:SqlDataSource>
                <div style="margin-top: 5px">
                    <telerik:RadButton ID="btnShowInfo" runat="server" Text="Show Info" Skin="Metro" AutoPostBack="true" Width="200px" OnClick="btnShowInfo_Click"></telerik:RadButton>
                </div>
            </div>
            <telerik:RadAjaxPanel ID="EmpInfoPanel" Visible="false" runat="server" LoadingPanelID="RadAjaxLoadingPanel1">
                <fieldset style="background:white;width:40%;margin-top:20px" >
                    <legend>
                        <asp:Label ID="Label16" runat="server" Text="Employee Info" Font-Size="Large"></asp:Label></legend>
                    <table style="width: 100%;">

                        <tr>
                            <td class="auto-style3" style="text-align: right">
                                <asp:Label ID="Label5" runat="server" Text="Branches :"></asp:Label>
                            </td>
                            <td>
                                <telerik:RadComboBox ID="cbbBraches" runat="server" Skin="Metro" Width="200px" DataSourceID="SqlDataSource2" DataTextField="Branches_Name" DataValueField="ID">
                                </telerik:RadComboBox>
                                <asp:SqlDataSource ID="SqlDataSource2" runat="server" ConnectionString="<%$ ConnectionStrings:TARS_DeliveryConnectionString %>" SelectCommand="SELECT [Branches_Name], [ID] FROM [t_BranchesInfo]"></asp:SqlDataSource>
                            </td>
                        </tr>
                        <tr>
                            <td class="auto-style3" style="text-align: right">
                                <asp:Label ID="Label1" runat="server" Text="First Name :"></asp:Label>
                            </td>
                            <td>
                                <telerik:RadTextBox ID="txtFName" runat="server" Skin="Metro" Width="200px">
                                </telerik:RadTextBox>
                                <asp:RequiredFieldValidator ID="RequiredFieldValidator3" runat="server" ControlToValidate="txtFName" ErrorMessage="(Must not Empty)" ForeColor="Red"></asp:RequiredFieldValidator>
                            </td>
                        </tr>
                        <tr>
                            <td class="auto-style4" style="text-align: right">
                                <asp:Label ID="Label2" runat="server" Text="Last Name :"></asp:Label>
                            </td>
                            <td class="auto-style2">
                                <telerik:RadTextBox ID="txtLName" runat="server" Skin="Metro" Width="200px">
                                </telerik:RadTextBox>
                                <asp:RequiredFieldValidator ID="RequiredFieldValidator4" runat="server" ControlToValidate="txtLName" ErrorMessage="(Must not Empty)" ForeColor="Red"></asp:RequiredFieldValidator>
                            </td>
                        </tr>
                        <tr>
                            <td class="auto-style4" style="text-align: right">
                                <asp:Label ID="Label7" runat="server" Text="Address :"></asp:Label>
                            </td>
                            <td class="auto-style2">
                                <telerik:RadTextBox ID="txtAddress" runat="server" Skin="Metro" Width="200px">
                                </telerik:RadTextBox>
                                <asp:RequiredFieldValidator ID="RequiredFieldValidator5" runat="server" ControlToValidate="txtAddress" ErrorMessage="(Must not Empty)" ForeColor="Red"></asp:RequiredFieldValidator>
                            </td>
                        </tr>
                        <tr>
                            <td class="auto-style3" style="text-align: right">
                                <asp:Label ID="Label8" runat="server" Text="City :"></asp:Label>
                            </td>
                            <td>
                                <telerik:RadTextBox ID="txtCity" runat="server" Skin="Metro" Width="200px">
                                </telerik:RadTextBox>
                                <asp:RequiredFieldValidator ID="RequiredFieldValidator6" runat="server" ControlToValidate="txtCity" ErrorMessage="(Must not Empty)" ForeColor="Red"></asp:RequiredFieldValidator>
                            </td>
                        </tr>
                        <tr>
                            <td class="auto-style3" style="text-align: right">
                                <asp:Label ID="Label9" runat="server" Text="State :"></asp:Label>
                            </td>
                            <td>
                                <telerik:RadTextBox ID="txtState" runat="server" Skin="Metro" Width="200px">
                                </telerik:RadTextBox>
                                <asp:RequiredFieldValidator ID="RequiredFieldValidator7" runat="server" ControlToValidate="txtState" ErrorMessage="(Must not Empty)" ForeColor="Red"></asp:RequiredFieldValidator>
                            </td>
                        </tr>
                        <tr>
                            <td class="auto-style3" style="text-align: right">
                                <asp:Label ID="Label14" runat="server" Text="Email :"></asp:Label>
                            </td>
                            <td>
                                <telerik:RadTextBox ID="txtEmail" runat="server" Skin="Metro" Width="200px">
                                </telerik:RadTextBox>
                                <asp:RequiredFieldValidator ID="RequiredFieldValidator8" runat="server" ControlToValidate="txtEmail" ErrorMessage="(Must not Empty)" ForeColor="Red"></asp:RequiredFieldValidator>
                            </td>
                        </tr>
                        <tr>
                            <td class="auto-style3" style="text-align: right">
                                <asp:Label ID="Label15" runat="server" Text="Phone :"></asp:Label>
                            </td>
                            <td>
                                <telerik:RadMaskedTextBox ID="txtPhone" runat="server" Mask="###-###-####" Skin="Metro" Width="200px">
                                </telerik:RadMaskedTextBox>
                                <asp:RequiredFieldValidator ID="RequiredFieldValidator1" runat="server" ControlToValidate="txtEmail" ErrorMessage="(Must not Empty)" ForeColor="Red"></asp:RequiredFieldValidator>
                            </td>
                        </tr>
                        <tr>
                            <td class="auto-style3" style="text-align: right">
                                <asp:Label ID="Label10" runat="server" Text="ZipCode :"></asp:Label>
                            </td>
                            <td>
                                <telerik:RadMaskedTextBox ID="txtZipCode" runat="server" Mask="#####-####" Skin="Metro" Width="200px">
                                </telerik:RadMaskedTextBox>
                                <asp:RangeValidator ID="RangeValidator1" runat="server" ControlToValidate="txtZipCode" ErrorMessage="Must be Integer" MaximumValue="9999999" MinimumValue="1"></asp:RangeValidator>
                                <asp:RequiredFieldValidator ID="RequiredFieldValidator10" runat="server" ControlToValidate="txtZipCode" ErrorMessage="(Must not Empty)" ForeColor="Red"></asp:RequiredFieldValidator>
                            </td>
                        </tr>
                        <tr>
                            <td class="auto-style3" style="text-align: right">
                                <asp:Label ID="Label11" runat="server" Text="SSN :"></asp:Label>
                            </td>
                            <td>
                                <telerik:RadMaskedTextBox ID="txtSSN" runat="server" Mask="###########" Skin="Metro" Width="200px">
                                </telerik:RadMaskedTextBox>
                                <asp:RangeValidator ID="RangeValidator2" runat="server" ControlToValidate="txtSSN" ErrorMessage="Must be Integer" MaximumValue="9999999" MinimumValue="1"></asp:RangeValidator>
                                <asp:RequiredFieldValidator ID="RequiredFieldValidator11" runat="server" ControlToValidate="txtSSN" ErrorMessage="(Must not Empty)" ForeColor="Red"></asp:RequiredFieldValidator>
                            </td>
                        </tr>
                        <tr>
                            <td class="auto-style3" style="text-align: right">
                                <asp:Label ID="Label6" runat="server" Text="UserType :"></asp:Label>
                            </td>
                            <td>
                                <telerik:RadComboBox ID="cbbUsertype" runat="server" Style="margin-bottom: 222" Skin="Metro" Text="Employee" Width="200px">
                                    <Items>
                                        <telerik:RadComboBoxItem runat="server" Selected="True" Text="Employee" Value="Employee" />
                                        <telerik:RadComboBoxItem runat="server" Text="Manager" Value="Manager" />
                                        <telerik:RadComboBoxItem runat="server" Text="Admin" Value="Admin" />
                                    </Items>
                                </telerik:RadComboBox>
                            </td>
                        </tr>
                        <tr>
                            <td class="auto-style3" style="text-align: right">
                                <asp:Label ID="Label12" runat="server" Text="Date of Birth :"></asp:Label>
                            </td>
                            <td>
                                <telerik:RadDatePicker ID="txtDOB" runat="server" Culture="en-US" Skin="Metro" Width="200px">
                                </telerik:RadDatePicker>
                            </td>
                        </tr>
                        <tr>
                            <td class="auto-style3" style="text-align: right">
                                <asp:Label ID="Label3" runat="server" Text="UserName :"></asp:Label>
                            </td>
                            <td>
                                <telerik:RadTextBox ID="txtUserName" runat="server" Skin="Metro" Width="200px" ReadOnly="True">
                                </telerik:RadTextBox>

                            </td>
                        </tr>
                        <tr>
                            <td class="auto-style3" style="text-align: right">&nbsp;</td>
                            <td>
                                <telerik:RadButton ID="btnUpdateInfo" runat="server" Skin="Metro" AutoPostBack="true" Text="Update Info" Width="200px" OnClick="btnUpdateInfo_Click">
                                </telerik:RadButton>

                            </td>
                        </tr>

                    </table>
                </fieldset>

            </telerik:RadAjaxPanel>

        </telerik:RadAjaxPanel>
        <telerik:RadAjaxLoadingPanel ID="RadAjaxLoadingPanel1" runat="server">
        </telerik:RadAjaxLoadingPanel>
</asp:Content>
